<template>

    <div>
        <el-table :data="List" border style="width: 100%" height="500px">
            <el-table-column fixed prop="" label="序号" width="50">
                <template slot-scope="scope">
                    {{ scope.$index + 1 }}
                </template>
            </el-table-column>
            <el-table-column fixed prop="pid" label="采购编号" width="100"/>
            <el-table-column fixed prop="gname" label="商品名称"/>
            <el-table-column fixed prop="number" label="数量"/>
            <el-table-column fixed prop="money" label="单价" width="100"/>
            <el-table-column fixed prop="price" label="总价" width="100"/>
            <el-table-column fixed prop="pdate" label="采购时间" width="200"/>

        </el-table>


    </div>
</template>

<script>
export default {
    name: 'Purchase',
    data(){
        return{
            List:[],
            dialogFormVisible: false,
            form: {

            },
            options:[],
            formLabelWidth: '120px'
        };
    },
    created() {
        this.getList();
        this.selPur();
    },
    methods: {
        getList() {
            this.$http.post('/oppo-back/purchase/select?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzA5OTQ2MjksInVzZXJfbmFtZSI6IndyIiwiYXV0aG9yaXRpZXMiOlsiZXBhc3N3b3JkPSQyYSQxMCRBUnkzN0Y5aGtBbjUualZxa1llcm5PRS93b2F2d1lZaUllcDQ0TmxFUnhMSGhSMGV5aDk2cSIsIkVtcChlbXBpZD0zIiwiZW5hbWU96Iqu6IquIiwicm9sZWlkPW51bGwiLCJwaG9uZT0xNDQyNjc4OTM0NiIsInNleD3lpbMiLCJhdXRob3JpdGllcz1udWxsKSIsImV1c2VybmFtZT13ciIsInBob3RvPW51bGwiLCJzdGF0ZT0wIl0sImp0aSI6IjI2YjViZDM2LTYxMWEtNDhiMy1iYTdhLWQ2YjAzZGRiZDQzNiIsImNsaWVudF9pZCI6Im9wcG8tYmFjayIsInNjb3BlIjpbImFsbCJdfQ.BhqPkvYq3qtdg6mzOzR89yd7ZTovvYx00MFOk6JGH_I').then(res => {
                console.log(res)
                this.$data.List = res;
            })
        },
        handleChange(value) {
            console.log(value);
            // this.form={}
        },
        selPur(){
            this.$http.post('/oppo-back/purchase/select?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzA5OTQ2MjksInVzZXJfbmFtZSI6IndyIiwiYXV0aG9yaXRpZXMiOlsiZXBhc3N3b3JkPSQyYSQxMCRBUnkzN0Y5aGtBbjUualZxa1llcm5PRS93b2F2d1lZaUllcDQ0TmxFUnhMSGhSMGV5aDk2cSIsIkVtcChlbXBpZD0zIiwiZW5hbWU96Iqu6IquIiwicm9sZWlkPW51bGwiLCJwaG9uZT0xNDQyNjc4OTM0NiIsInNleD3lpbMiLCJhdXRob3JpdGllcz1udWxsKSIsImV1c2VybmFtZT13ciIsInBob3RvPW51bGwiLCJzdGF0ZT0wIl0sImp0aSI6IjI2YjViZDM2LTYxMWEtNDhiMy1iYTdhLWQ2YjAzZGRiZDQzNiIsImNsaWVudF9pZCI6Im9wcG8tYmFjayIsInNjb3BlIjpbImFsbCJdfQ.BhqPkvYq3qtdg6mzOzR89yd7ZTovvYx00MFOk6JGH_I').then(res=>{
                this.$data.options = res;
            })
        }
        //,
        // submits(from){
        //     this.$http.post('/purchase/insert',this.$data.form).then(res=>{
        //         console.log(res)
        //         if (res){
        //             this.$message.success("成功");
        //             this.getList();
        //             this.dialogFormVisible=false;
        //         }else {
        //             this.$message.error("失败");
        //             this.dialogFormVisible=false;
        //         }
        //     })
        // }
    }

}
</script>

<style scoped>

</style>
